#include "Vakje.h"
#include "Muur.h"
#include "Vloer.h"
#include "Drain.h"
#include "Laser.h"
#include "Reparatievak.h"
#include "Startpositie.h"
#include "Checkpoint.h"
#include "Afgrond.h"

Vakje* Vakje::create( char type, char arg )
{
	Vakje * result;

	switch(type)
	{
		case 'M':	result = new Muur();
					break;

		case 'V':	result = new Vloer();
					break;

		case 'D':   result = new Drain();
					break;

		case 'L':   result = new Laser(static_cast<Rotatie>(arg - '0'));
					break;
		case 'R':   result = new Reparatievak();
					break;
		case 'S':   result = new Startpositie();
				    break;
		case 'C':   result = new Checkpoint(static_cast<int>(arg - '0'));
					break;
		case 'A':   result = new Afgrond();
				    break;
		default:	result = new Vloer();
					break;
	}

	return result;
}

